import { createRouter, createWebHistory } from 'vue-router';

import routes from './routes';

const router = createRouter({
    scrollBehavior(_, __, savedPosition) {
        if (savedPosition) {
            return savedPosition;
        } else {
            return { top: 0 };
        }
    },
    routes: [...routes],
    history: createWebHistory(),
});

export default router;
